package com.credit.management.system.generator.dao;

import com.credit.management.system.model.Syrole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SyroleMapper {
    @Delete({
        "delete from syrole",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into syrole (id, rolename, ",
        "roledetail)",
        "values (#{id,jdbcType=INTEGER}, #{rolename,jdbcType=VARCHAR}, ",
        "#{roledetail,jdbcType=VARCHAR})"
    })
    int insert(Syrole record);

    int insertSelective(Syrole record);

    @Select({
        "select",
        "id, rolename, roledetail",
        "from syrole",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.credit.management.system.generator.dao.SyroleMapper.BaseResultMap")
    Syrole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Syrole record);

    @Update({
        "update syrole",
        "set rolename = #{rolename,jdbcType=VARCHAR},",
          "roledetail = #{roledetail,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Syrole record);
}